Post

Replies

Boosts

Views

Activity

Reply to NSTokenField - How To Tell If I'm Editing an Existing Token in -tokenField:representedObjectForEditingString: ?
Thanks for responding. For some reason I didn’t get an email notification. I can’t use the editing string like that because the editing string is user controlled and isn’t guaranteed to be unique (the user can type the same editing string for different tokens which is valid for what I’m trying to do). So it looks like I’m going to have to write my own.
Topic: UI Frameworks SubTopic: AppKit Tags:
3d
Reply to After binding to NSBrowser indexPaths the browser assumes I'm using NSBrowserCell and calls unimplemented methods on my NSCell subclass
Thanks a lot for the reply! I had a bug I recently introduced in my app where I missed syncing model/UI with a selection change. I was already using the target-action but my app is pretty large and also programmatically changes the selection in many different places. As far as a I know there is no way to pick up all selection changes globally (other than the binding) so I decided to try the binding but that didn't work out as described in the original post. So instead of the binding to resolve I'm now overriding four different set methods (in addition to responding in the target-action). - (void)selectRow:(NSInteger)row inColumn:(NSInteger)column; - (void)selectRowIndexes:(NSIndexSet *)indexes inColumn:(NSInteger)column -(void)setSelectionIndexPath:(NSIndexPath *)selectionIndexPath -(void)setSelectionIndexPaths:(NSArray<NSIndexPath *> *)selectionIndexPaths Maybe overriding only two is required, not sure but if so that is undocumented and subject to change anyway. So a binding or a notification like NSBrowserSelectionDidChangeNotification would be preferred. and FBs from real-world cases like yours raise the priority on those gaps. I've been filing enhancement/bugs on NSBrowser for nearly 10 years. Searching Feedback Assistant I filed something about selection change in 2017: FB5335246 My most recent NSBrowser Feedbacks (though unrelated to this): FB22704799 FB22641162 FB5417493 FB20298148 Old school: FB5447156 -- Unfortunately NSBrowser seems to be frozen in time. I've thought about writing my own several times over the years but I'm always working on other things and I usually find a workaround for the browser (which takes a long time to write and is frustrating) so I haven't been able to motivate myself to write my own completely from scratch. I think column view is like everyone's favorite view type in Finder...so it would be great if this control got some love from Apple!
Topic: UI Frameworks SubTopic: AppKit Tags:
4w
Reply to Count of Windows Open in App Switcher on iPadOS? Tried Via UIApplication.sharedApplication.openSessions
So I decided to give up on this because I don't think it is currently possible. There is a button on iPadOS "Restore Recently Closed Windows" in the upper left corner that becomes visible when you are in the app switcher... so I guess iPadOS keeps some closed windows in the openSessions set but there appears to be no way to distinguish these windows verses the archived ones in the app switcher. I could be wrong and maybe I missed something, but not worth spending anymore time trying to figure it out.
Topic: UI Frameworks SubTopic: UIKit Tags:
4w
Reply to Xcode 26.4: IBOutlets/IBActions gutter circles missing — cannot connect storyboard to code (works in 26.3)
So I just discovered a related misbehavior for inherited properties. FWIW I'm in ObjC. If your superclass declares a public IBOutlet and then in your xib your subclass connects it, now Interface Builder incorrectly displays a warning triangle saying that your class has no such outlet. Example: @interface MySuperClass : NSObject @property (weak, nonatomic, nullable) IBOutlet NSMenu *menuSampler; @end @interface MySubclass : MySuperClass @end Use MySubclass in xib and connect outlet to menuSampler and I get a warning triangle. Not sure if this is required to reproduce but the superclass is in another framework.
May ’26
Reply to Xcode 26.4: IBOutlets/IBActions gutter circles missing — cannot connect storyboard to code (works in 26.3)
Is it only with objC code or Swift as well ? Xcode 26.5: In new iOS storyboard project I can connect IBOutlets from the Assistant editor in Swift...looks fixed there. Connection bubbles show. But in Objective-C the connection bubbles are completely gone from source files so in ObjC the problem is not fixed, actually worse. You can connect from the Connections Inspector though, but Xcode won't display "connection" status in ObjC source. So for me, because I still use ObjC the problem is worse. Hope that's not intentional. That would be very very negative evolution. You mean typing xibs by hand doesn't make you more productive!? 😂
May ’26
Reply to NSCollectionView's 'selection box' freezes if you right-click during dragging
No problem. I also just noticed if you do the selection quite rapidly the selection box can also get stuck (no right click required). Seems to happen when collection view is grouped though I'm not sure exactly if that has anything to do with it (so in Finder "Use Groups" with section headers). Also if you mouse drag while you are doing the selection box outside the collection view (to the point where your cursor extends into the sidebar in Finder) things sometimes stop working. What things stop working? Mouse clicks. The collection view temporarily stops responding to mouse clicks. Using the arrow keys to move the selection 'fixes it' then mouse clicks start working again. My app uses an NSSplitView and has sidebar and a collection view so my app is impacted the same way. My hope is because Finder is impacted they may fix. Fingers crossed. In my app when this mouse clicking problem happens I am getting -mouseDown: in my NSCollectionView subclass (and calling super) but the collection view just doesn't modify the selection when you click on items nor does it deselect when you click on the background.
Topic: UI Frameworks SubTopic: AppKit Tags:
May ’26
Reply to ToolbarItemGroup With Palette Style Cannot Present a View Controller While the Context Menu Is Visible
IFIRC I’ve had success working around this kind of issue by getting the transitionCoordinator and adding an empty animation alongside it and then presenting the view controller in the completion handler. Fallback and just present it if transition coordinator is nil. https://developer.apple.com/documentation/uikit/uiviewcontroller/transitioncoordinator?language=objc I don‘t SwiftUI though so Albert‘s answer might be the better one for your project
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’26
Reply to How can I reliably get the final restored window size on macOS when onAppear / viewDidAppear fires too early?
You should be able to do this. Try using: + (void)restoreWindowWithIdentifier:(NSUserInterfaceItemIdentifier)identifier state:(NSCoder *)state completionHandler:(void (^)(NSWindow * _Nullable, NSError * _Nullable))completionHandler NS_SWIFT_UI_ACTOR API_AVAILABLE(macos(10.7)); https://developer.apple.com/documentation/appkit/nswindowrestoration/restorewindow(withidentifier:state:completionhandler:)?language=objc Appkit restores window frames automatic but if something funky is going on and that is being done too late you can ensure the window size is restored early by setting it yourself in +restoreWindowWithIdentifier:state:completionHandler: before you call the completionHandler.
Topic: UI Frameworks SubTopic: General Tags:
May ’26
Reply to iPadOS 26 - Status bar overlaps with navigation bar
I experience this issue every day, across many different apps, all the time on my iPhone SE 3rd gen. I've just been ignoring because I've been kind of busy with macOS. But really an annoying bug. Happens in Safari all the time. Usually after playing a video on YouTube. But it happens other times too. Seeing this thread was posted way back in September is kind of demoralizing I think.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’26
Reply to NSTokenField - How To Tell If I'm Editing an Existing Token in -tokenField:representedObjectForEditingString: ?
Thanks for responding. For some reason I didn’t get an email notification. I can’t use the editing string like that because the editing string is user controlled and isn’t guaranteed to be unique (the user can type the same editing string for different tokens which is valid for what I’m trying to do). So it looks like I’m going to have to write my own.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
3d
Reply to NSTokenField Per Token Color
10 year later I filed a Feedback for this feature request 😂
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
1w
Reply to NSMetadataQuery - The Rules For OperationQueue?
If you change properties that implicitly cause the query to stop/restart on another queue (say from the main queue) the system logs out: NSMetadataQuery: has been started, but a modification to it was made from a different run loop or queue. Here's the backtrace: ( ... )
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
2w
Reply to NSMetadataQuery - The Rules For OperationQueue?
Hmm, I'll just wrap NSMetadataQuery behind my own class I think. I am assuming all properties need to be set on the operation queue, and I call start/stop on the operation queue as well.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
2w
Reply to AppKit & State Restoration: Windows Auto Closing On App Quit Breaks State Restoration
So actually in System Settings I had the "Close windows when quitting an application" preference turned on, so the behavior I was witnessing in my testing is correct. It looks like Mail.app plays by its own rules because it decides to restore the windows anyway. It appears AppKit is doing the right thing here.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
4w
Reply to After binding to NSBrowser indexPaths the browser assumes I'm using NSBrowserCell and calls unimplemented methods on my NSCell subclass
Thanks a lot for the reply! I had a bug I recently introduced in my app where I missed syncing model/UI with a selection change. I was already using the target-action but my app is pretty large and also programmatically changes the selection in many different places. As far as a I know there is no way to pick up all selection changes globally (other than the binding) so I decided to try the binding but that didn't work out as described in the original post. So instead of the binding to resolve I'm now overriding four different set methods (in addition to responding in the target-action). - (void)selectRow:(NSInteger)row inColumn:(NSInteger)column; - (void)selectRowIndexes:(NSIndexSet *)indexes inColumn:(NSInteger)column -(void)setSelectionIndexPath:(NSIndexPath *)selectionIndexPath -(void)setSelectionIndexPaths:(NSArray<NSIndexPath *> *)selectionIndexPaths Maybe overriding only two is required, not sure but if so that is undocumented and subject to change anyway. So a binding or a notification like NSBrowserSelectionDidChangeNotification would be preferred. and FBs from real-world cases like yours raise the priority on those gaps. I've been filing enhancement/bugs on NSBrowser for nearly 10 years. Searching Feedback Assistant I filed something about selection change in 2017: FB5335246 My most recent NSBrowser Feedbacks (though unrelated to this): FB22704799 FB22641162 FB5417493 FB20298148 Old school: FB5447156 -- Unfortunately NSBrowser seems to be frozen in time. I've thought about writing my own several times over the years but I'm always working on other things and I usually find a workaround for the browser (which takes a long time to write and is frustrating) so I haven't been able to motivate myself to write my own completely from scratch. I think column view is like everyone's favorite view type in Finder...so it would be great if this control got some love from Apple!
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
4w
Reply to Count of Windows Open in App Switcher on iPadOS? Tried Via UIApplication.sharedApplication.openSessions
So I decided to give up on this because I don't think it is currently possible. There is a button on iPadOS "Restore Recently Closed Windows" in the upper left corner that becomes visible when you are in the app switcher... so I guess iPadOS keeps some closed windows in the openSessions set but there appears to be no way to distinguish these windows verses the archived ones in the app switcher. I could be wrong and maybe I missed something, but not worth spending anymore time trying to figure it out.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
4w
Reply to Xcode 26.4: IBOutlets/IBActions gutter circles missing — cannot connect storyboard to code (works in 26.3)
So I just discovered a related misbehavior for inherited properties. FWIW I'm in ObjC. If your superclass declares a public IBOutlet and then in your xib your subclass connects it, now Interface Builder incorrectly displays a warning triangle saying that your class has no such outlet. Example: @interface MySuperClass : NSObject @property (weak, nonatomic, nullable) IBOutlet NSMenu *menuSampler; @end @interface MySubclass : MySuperClass @end Use MySubclass in xib and connect outlet to menuSampler and I get a warning triangle. Not sure if this is required to reproduce but the superclass is in another framework.
Replies
Boosts
Views
Activity
May ’26
Reply to Xcode 26.4: IBOutlets/IBActions gutter circles missing — cannot connect storyboard to code (works in 26.3)
Is it only with objC code or Swift as well ? Xcode 26.5: In new iOS storyboard project I can connect IBOutlets from the Assistant editor in Swift...looks fixed there. Connection bubbles show. But in Objective-C the connection bubbles are completely gone from source files so in ObjC the problem is not fixed, actually worse. You can connect from the Connections Inspector though, but Xcode won't display "connection" status in ObjC source. So for me, because I still use ObjC the problem is worse. Hope that's not intentional. That would be very very negative evolution. You mean typing xibs by hand doesn't make you more productive!? 😂
Replies
Boosts
Views
Activity
May ’26
Reply to NSCollectionView's 'selection box' freezes if you right-click during dragging
No problem. I also just noticed if you do the selection quite rapidly the selection box can also get stuck (no right click required). Seems to happen when collection view is grouped though I'm not sure exactly if that has anything to do with it (so in Finder "Use Groups" with section headers). Also if you mouse drag while you are doing the selection box outside the collection view (to the point where your cursor extends into the sidebar in Finder) things sometimes stop working. What things stop working? Mouse clicks. The collection view temporarily stops responding to mouse clicks. Using the arrow keys to move the selection 'fixes it' then mouse clicks start working again. My app uses an NSSplitView and has sidebar and a collection view so my app is impacted the same way. My hope is because Finder is impacted they may fix. Fingers crossed. In my app when this mouse clicking problem happens I am getting -mouseDown: in my NSCollectionView subclass (and calling super) but the collection view just doesn't modify the selection when you click on items nor does it deselect when you click on the background.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to NSCollectionView's 'selection box' freezes if you right-click during dragging
I filed FB22716998
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to NSCollectionView's 'selection box' freezes if you right-click during dragging
This seems to avoid the issue: -(void)rightMouseDown:(NSEvent*)theEvent { if ((NSEvent.pressedMouseButtons & (1 << 0)) != 0) { // Not at the same time, dog. return; } [super rightMouseDown:theEvent]; }
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to ToolbarItemGroup With Palette Style Cannot Present a View Controller While the Context Menu Is Visible
IFIRC I’ve had success working around this kind of issue by getting the transitionCoordinator and adding an empty animation alongside it and then presenting the view controller in the completion handler. Fallback and just present it if transition coordinator is nil. https://developer.apple.com/documentation/uikit/uiviewcontroller/transitioncoordinator?language=objc I don‘t SwiftUI though so Albert‘s answer might be the better one for your project
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to How can I reliably get the final restored window size on macOS when onAppear / viewDidAppear fires too early?
You should be able to do this. Try using: + (void)restoreWindowWithIdentifier:(NSUserInterfaceItemIdentifier)identifier state:(NSCoder *)state completionHandler:(void (^)(NSWindow * _Nullable, NSError * _Nullable))completionHandler NS_SWIFT_UI_ACTOR API_AVAILABLE(macos(10.7)); https://developer.apple.com/documentation/appkit/nswindowrestoration/restorewindow(withidentifier:state:completionhandler:)?language=objc Appkit restores window frames automatic but if something funky is going on and that is being done too late you can ensure the window size is restored early by setting it yourself in +restoreWindowWithIdentifier:state:completionHandler: before you call the completionHandler.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to iPadOS 26 - Status bar overlaps with navigation bar
I experience this issue every day, across many different apps, all the time on my iPhone SE 3rd gen. I've just been ignoring because I've been kind of busy with macOS. But really an annoying bug. Happens in Safari all the time. Usually after playing a video on YouTube. But it happens other times too. Seeing this thread was posted way back in September is kind of demoralizing I think.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’26